package com.cloudbroker.bcs.platform.dav.middle.bizservice.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.base.vo.HSBCPSVO;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.hsopen.HsOpenBizService;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.hsopen.result.OpenTokenBackForm;
import com.cloudbroker.bcs.platform.dav.middle.extservice.hsopen.HsOpenService;
import com.cloudbroker.bcs.platform.dav.middle.extservice.itn.token.ITNTokenFactory;

/**
 * Created by xuyn15828 on 2016/3/30.
 */
@Service
public class HsOpenBizServiceImpl implements HsOpenBizService {
    @Resource
    private HsOpenService hsOpenService;

    @Override
    public OpenTokenBackForm funcGetHsOpenToken(HSBCPSVO param) {
        OpenTokenBackForm resMap = new OpenTokenBackForm();
        resMap.setAccess_token(ITNTokenFactory.getInstance().getToken());
        return VOUtil.setSuccessResult(resMap);
    }

    @Override
    public HSBCPSBackVO funcStockUploadTask(HSBCPSVO param) {
        hsOpenService.stockUpdate();
        return VOUtil.genSuccessBackVo();
    }
}
